import axios from 'axios';
const BASE_URL = "http://admin.gxxmglzx.com/tender/test"

//解构赋值，传入一个对象 里面包含url和数据data
export default function({ url, data = { } }){
    return new Promise(resolve => {
        axios.get(BASE_URL+url,{params:data}).then(res=>{
            if(res.data.errcode === 200){
                resolve(res.data);
            }else{
                console.log(res.errmsg);
            }
        }).catch(err=>{
            console.log(err);
        })
    })
    
}